<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	$list = array(
			array('title'=>'个性类','list'=>array(
				array('name'=>'jy_jdwyn','title'=>'维也纳酒店','desc'=>'个性维也纳酒店模式！','icon'=>''),
				array('name'=>'jy_jd7day','title'=>'7天快捷酒店','desc'=>'个性7天快捷酒店模式','icon'=>''),
				array('name'=>'jy_jddiy','title'=>'酒店装修','desc'=>'自由搭建个性酒店页面，做不一样的自己！','icon'=>''),
				array('name'=>'jy_commission','title'=>'微客分销','desc'=>'让酒店支持裂变分销！','icon'=>''),
			)),
	);
	foreach($list as &$type){
		foreach($type['list'] as &$p){
			$install = pdo_get('core_plugins',array('name'=>$p['name']));
			if($install){
				$p['is_install'] = 1;
			}else{
				$p['is_install'] = 0;
			}
			
		}
	}
	foreach($list as $k=>&$type){
		foreach($type['list'] as $i=>&$p){
			$install = check_permission($p['name']);
			$plugin=pdo_get('core_plugins',array('name'=>$p['name']),array('title','image','hide'));
			if($plugin['hide']){
				unset($type['list'][$i]);
			}
			if($install){
				$p['title']=$p['name']!='jy_jd' && $plugin['title']?$plugin['title']:$p['title'];
				$p['image']=$p['image']?:$plugin['image'];
				$p['is_install'] = 1;
				$p['is_show'] = 1;
			}else{
				$noplugins[]=$p['name'];
				//unset($type['list'][$i]);
				$p['is_install'] = 0;
				$p['is_show'] = 0;
				if($_SESSION['isfounder']){
					$p['is_show'] = 1;
				}
			}
		}
	}
	if($_RQ['title']){
		$return['params']['title']=$_RQ['title'];
		foreach($list as &$pv){
			foreach($pv['list'] as $k=>$lv){
				if(strpos($lv['title'],$_RQ['title']) !== false){ 
					
				}else{
					unset($pv['list'][$k]);
				}
			}
		}
	}
	$return['item']['list']=$list;
	$htmls=array(
		'type' => 'look',
		'desc' =>'应用',
		'look' => array(
			array('type'=>'search_one','title'=>'应用名称','name'=>'title'),
			array('type'=>'plugins','title'=>'酒店应用','style'=>2,'pluginname'=>'jy_jd','name'=>'list'),
		)
	);
	$return['htmls']=$htmls;
	set_html('title','应用面板');
	exi($return);
}

?>